﻿
using RTW.DAL;
using RTW.OA.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace RTW.OA.Areas.System.Servers
{
    public class WorkServers
    {
	    private readonly IRepository<wf_workinfo> wf_workinfoRepository;

        public WorkServers()
        {
            wf_workinfoRepository = new DapperRepository<wf_workinfo>();

        }

        public List<wf_workinfo> GetData()
        {
            return wf_workinfoRepository.GetAllEnumerable().ToList();
        }

        public wf_workinfo GetModelById(string id)
        {
            return wf_workinfoRepository.GetById(id);
        }

		
        internal void Add(wf_workinfo model)
        {
            wf_workinfoRepository.Insert(model);
        }

        internal void Update(wf_workinfo model)
        {
            wf_workinfoRepository.Update(model);
        }

		internal void Del(string id)
        {
            wf_workinfoRepository.DeleteByIds(id);
        }

	}
}